/* Routine to check correctness of the results */

__attribute__((unused))
static int
saturate_b (int i)
{
  if (i > 127)
    i = 127;
  else if (i < -128)
    i = -128;
  return i;
}

__attribute__((unused))
static int
saturate_w (int i)
{
  if (i > 32767)
    i = 32767;
  else if (i < -32768)
    i = -32768;
  return i;
}

__attribute__((unused))
static int
saturate_ub (int i)
{
  if (i > 255)
    i = 255;
  else if (i < 0)
    i = 0;
  return i;
}

__attribute__((unused))
static int
saturate_uw (int i)
{
  if (i > 65535)
    i = 65535;
  else if (i < 0)
    i = 0;
  return i;
}

static long long MMXops[] =
{
  0x3467512347612976LL, 0x000000000000000eLL,
  0x3467512347612976LL, 0x0000000000000014LL,
  0x3467512347612976LL, 0x000000000000003cLL,
  0x0000000000000000LL, 0xFFFFFFFFFFFFFFFFLL,
  0xFFFFFFFFFFFFFFFFLL, 0x0000000000000000LL,
  0x0000000000000001LL, 0x1000000000000000LL,
  0x1000000000000000LL, 0x0000000000000001LL,
  0xFF00FF00FF00FF00LL, 0x00FF00FF00FF00FFLL,
  0xFFFFFFFFFFFFFFFFLL, 0x0101010101010101LL,
  0x0101010101010101LL, 0xFFFFFFFFFFFFFFFFLL,
  0x0123456789ABCDEFLL, 0x0123456789ABCDEFLL,
  0x3467512347612976LL, 0x1839876340879234LL,
  0x0000000000000000LL, 0x0000000000000000LL,
  0xFFFFFFFFFFFFFFFFLL, 0xFFFFFFFFFFFFFFFFLL,
  0x7F7F7F7F7F7F7F7FLL, 0x7F7F7F7F7F7F7F7FLL,
  0x7F7F7F7F7F7F7F7FLL, 0x0101010101010101LL,
  0x7F7F7F7F7F7F7F7FLL, 0x4782082349761237LL,
  0x0000000000000000LL, 0x7F7F7F7F7F7F7F7FLL,
  0x8080808080808080LL, 0x8080808080808080LL,
  0x0101010101010101LL, 0x8080808080808080LL,
  0x8080808080808080LL, 0x0000000000000000LL,
  0x2372347120982458LL, 0x8080808080808080LL,
  0xFFFFFFFFFFFFFFFFLL, 0x8080808080808080LL,
  0x7F7F7F7F7F7F7F7FLL, 0xFFFFFFFFFFFFFFFFLL,
  0x8080808080808080LL, 0x7F7F7F7F7F7F7F7FLL,
  0xFFFFFFFFFFFFFFFFLL, 0x7F7F7F7F7F7F7F7FLL
};

#define MMX_num_ops (sizeof (MMXops) / sizeof (MMXops[0]))
